# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

module(
    name = "iceoryx2",
    version = "0.6.1",
    bazel_compatibility = [">=7.2.1"],
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "iceoryx", version = "2.95.4")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_rust", version = "0.61.0")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
    edition = "2021",
)
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
    name = "iceoryx2_crate_index",
    cargo_lockfile = "//:Cargo.lock",
    generate_binaries = True,
    manifests = [
        "//:Cargo.toml",
        "//benchmarks/event:Cargo.toml",
        "//benchmarks/publish-subscribe:Cargo.toml",
        "//benchmarks/queue:Cargo.toml",
        "//benchmarks/request-response:Cargo.toml",
        "//:examples/Cargo.toml",
        "//iceoryx2:Cargo.toml",
        "//iceoryx2-bb/container:Cargo.toml",
        "//iceoryx2-bb/derive-macros:Cargo.toml",
        "//iceoryx2-bb/elementary:Cargo.toml",
        "//iceoryx2-bb/elementary-traits:Cargo.toml",
        "//iceoryx2-bb/lock-free:Cargo.toml",
        "//iceoryx2-bb/log:Cargo.toml",
        "//iceoryx2-bb/memory:Cargo.toml",
        "//iceoryx2-bb/posix:Cargo.toml",
        "//iceoryx2-bb/system-types:Cargo.toml",
        "//iceoryx2-bb/testing:Cargo.toml",
        "//iceoryx2-bb/threadsafe:Cargo.toml",
        "//iceoryx2-bb/trait-tests:Cargo.toml",
        "//iceoryx2-cal:Cargo.toml",
        "//iceoryx2-cli:Cargo.toml",
        "//iceoryx2-ffi/ffi:Cargo.toml",
        "//iceoryx2-ffi/ffi-macros:Cargo.toml",
        "//iceoryx2-pal/concurrency-sync:Cargo.toml",
        "//iceoryx2-pal/configuration:Cargo.toml",
        "//iceoryx2-pal/posix:Cargo.toml",
        "//iceoryx2-services/discovery:Cargo.toml",
    ],
)
use_repo(crate, crate_index = "iceoryx2_crate_index")

bazel_dep(name = "rules_rust_bindgen", version = "0.61.0")
register_toolchains("@rules_rust_bindgen//:default_bindgen_toolchain")
